/*    */ package com.yc.util;
/*    */ 
/*    */ import java.io.File;
/*    */ import org.apache.commons.logging.Log;
/*    */ import org.apache.commons.logging.LogFactory;
/*    */ 
/*    */ public class UtilBtsm
/*    */ {
/* 11 */   private static final Log log = LogFactory.getLog(UtilBtsm.class);
/*    */ 
/*    */   public static void createFolder(String strFolder)
/*    */   {
/* 15 */     log.info("create [" + strFolder + "] folder ....begin...");
/* 16 */     File file = new File(strFolder);
/* 17 */     boolean bFile = file.exists();
/* 18 */     if (bFile)
/*    */     {
/* 20 */       log.info("The folder exists.");
/*    */     }
/*    */     else {
/* 23 */       log.info("The folder do not exist,now trying to create a one...");
/* 24 */       bFile = file.mkdirs();
/* 25 */       if (bFile)
/* 26 */         log.info("Create successfully!");
/*    */       else
/* 28 */         log.info("Disable to make the [" + strFolder + "] folder,please check the disk is full or not.");
/*    */     }
/*    */   }
/*    */ 
/*    */   public static void deleteFolder(String strFolderPath)
/*    */   {
/* 35 */     log.info("delete [" + strFolderPath + "] folder ....begin...");
/* 36 */     File file = new File(strFolderPath);
/* 37 */     if (!file.isDirectory()) {
/* 38 */       file.delete();
/* 39 */     } else if (file.isDirectory()) {
/* 40 */       String[] filelist = file.list();
/* 41 */       for (int i = 0; i < filelist.length; i++) {
/* 42 */         File delfile = new File(strFolderPath + "\\" + filelist[i]);
/* 43 */         if (!delfile.isDirectory())
/* 44 */           delfile.delete();
/* 45 */         else if (delfile.isDirectory())
/* 46 */           deleteFolder(strFolderPath + "\\" + filelist[i]);
/*    */       }
/* 48 */       file.delete();
/*    */     }
/*    */   }
/*    */ 
/*    */   public static void deleteFile(String path, String fileName) {
/* 53 */     log.info("delete [" + fileName + "] file ....begin...");
/* 54 */     File file = new File(path, fileName);
/* 55 */     if (!file.isDirectory()) {
/* 56 */       file.delete();
/*    */     }
/* 58 */     log.info("delete [" + fileName + "] file ....end...");
/*    */   }
/*    */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     com.yc.util.UtilBtsm
 * JD-Core Version:    0.6.2
 */